const { default: classNames } = require('classnames')
const _ = require('../utils')

_.create('fab', {
  properties: {
    type: {
      type: String,
      value: 'primary',
    },

    size: {
      type: String,
      value: 'normal',
    },

    disabled: Boolean,
    bottom: Boolean,
    top: Boolean,
    left: Boolean,
    right: Boolean,
    center: Boolean,
  },
  computed: {
    classes(data) {
      const { classPrefix, disabled, type, size, top, bottom, left, right, center } = data
      const classes = classNames(classPrefix, `${classPrefix}-${type}`, `${classPrefix}-${size}`, {
        [`${classPrefix}-top`]: top,
        [`${classPrefix}-bottom`]: bottom,
        [`${classPrefix}-left`]: left && !center && !right,
        [`${classPrefix}-center`]: center && !left && !right,
        [`${classPrefix}-right`]: right,
        [`${classPrefix}-disabled`]: disabled,
      })
      return classes
    },
  },
})
